package com.augmentum.springcloudproductservice.controller;

import com.augmentum.springcloudproductservice.dto.UserDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/feign")
@Slf4j
public class FeignServerController {

    @PostMapping("/msg")
    public String hello(@RequestBody UserDTO userDTO) {
        log.info("user: " + userDTO);
        return "hello " + userDTO.getName();
    }

    @GetMapping("/msg")
    public String helloYou(String name) {
        return "hello " + name;
    }

    @PutMapping("/msg")
    public String hellDelete(String name) {
        return "hello" + name;
    }

    @DeleteMapping("/msg")
    public String helloPut(String name) {
        return "hello" + name;
    }
}
